const express = require('express')
const multer = require('multer')
const router = express.Router()
const upload = multer({ dest: './upload/' })
router.post('/upload', upload.single('file'), (req, res) => {
    // console.log(req.file);
    const fileExt = req.file.originalname.substring(req.file.originalname.lastIndexOf('.') + 1);
    const path = "http:127.0.0.1:8080/" + req.file.filename + '.' + fileExt;
    console.log(path);
})
module.exports = router